import React from 'react';
import { SearchBar } from 'antd-mobile'
import { useHistory } from 'react-router-dom'
const Mysearch = () => {
    const his = useHistory()
    return (
        <div style={{
            display: 'flex',
            alignItems: 'center',
            background: 'red',
            padding: "10px 0"

        }}>
            <span style={{
                padding: '0 5px',
                fontSize: '16px',
                color: 'white'
            }}>地址</span>
            <SearchBar
                placeholder='请输入内容'
                style={{
                    '--border-radius': '100px',
                    '--background': '#ffffff',
                    '--height': '40px',
                    '--padding-left': '12px',
                    flex: 1
                }}
            />
            <span
                style={{
                    padding: '0 5px',
                    fontSize: '16px',
                    color: 'white'
                }}
                onClick={
                    () => {
                        his.push(localStorage.getItem('token') ? '/mine' : '/login')
                    }
                }

            >{localStorage.getItem('token') ? '我的' : '登录'}</span>
        </div>
    );
}

export default Mysearch;
